//
//  MainViewController.m
//  Normal
//
//  Created by 8b410-2 on 16/12/9.
//  Copyright © 2016年 abb. All rights reserved.
//

#import "MainViewController.h"
#import "BaseViewController.h"
#import "BaseNavigationController.h"
@interface MainViewController ()

@end

@implementation MainViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    BaseViewController *fristVC = [[BaseViewController alloc] init];
    BaseViewController *secondVC = [[BaseViewController alloc] init];
    self.viewControllers = @[[self addNavigationForViewController:fristVC],
                             [self addNavigationForViewController:secondVC],
                             ];
    
    NSArray *titles = @[@"接发单",@"工程师",@""];
    NSArray *images = @[@"接发单",@"电脑帮",@""];
    [self.tabBar.items enumerateObjectsUsingBlock:^(UITabBarItem *item, NSUInteger idx, BOOL *stop) {
        [item setTitle:titles[idx]];
        [item setImage:[UIImage imageNamed:images[idx]]];
        [item setSelectedImage:[UIImage imageNamed:[images[idx] stringByAppendingString:@"_highlighted"]]];
    }];
}
#pragma mark - 添加nav到vc上
- (BaseNavigationController *)addNavigationForViewController:(UIViewController *)viewController {
    BaseNavigationController *navigationController = [[BaseNavigationController alloc] initWithRootViewController:viewController];
    return navigationController;
}

@end
